<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<style type="text/css">
    body{
        height: 100%;
        width: 100%;
    }
    .layui-form-label{width: 130px}
    .btn {
        background-color: #e5e5e5;
        background-image: none;
        filter: none;
        border: 0;
        padding: 7px 14px;
        text-shadow: none;
        font-family: "Segoe UI", Helvetica, Arial, sans-serif;
        font-size: 14px;
        color: #333333;
        cursor: pointer;
        outline: none;
        -webkit-box-shadow: none !important;
        -moz-box-shadow: none !important;
        box-shadow: none !important;
        -webkit-border-radius: 0 !important;
        -moz-border-radius: 0 !important;
        border-radius: 0 !important;
    }
    .layui-input-inline{width: 214px !important}


</style>
<link rel="stylesheet" href="../../../layui/css/layui.css">
<script src="../../../layui/layui.js"></script>
<script type="text/javascript" src="../../../js/jquery-2.1.1.min.js"></script>
<script type="text/javascript" src="../../../js/main.js"></script>
<body>
<div class="x-body layui-anim layui-anim-up">
    <div class="layui-fluid">

        <form class="layui-form layui-form-pane1" lay-filter="first">
            <div class="layui-form-item">
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label"><span class="text-error">*</span>职务名称：</label>
                <div class="layui-input-inline">
                    <input name="jobName" id="jobName" placeholder="请输入职务名称" value="" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label"><span class="text-error">*</span>职务等级：</label>
                <div class="layui-input-inline">
                    <input name="jobLevel" id="jobLevel" placeholder="请输入职务等级" value="" class="layui-input">
                </div>
            </div>



            <div class="layui-form-item" style="margin-left: 140px;">
                <!--<p id="btnGroup" class="pull-right">-->
                <button class="layui-btn save"  lay-submit="" lay-filter="*">保存</button>
                <button class="layui-btn quxiao" >取消</button>
                <!--</p>-->
            </div>


            <input name="recordType" id="recordType"  value="1" type="hidden"  class="layui-input">


        </form>
    </div>
</div>
</body>
</html>
<script type="text/javascript">

    //重新渲染表单
    function renderForm(){
        layui.use('form', function(){
            var form = layui.form;
            form.render();
        });

    }


    layui.use(['element', 'layer', 'jquery','form','laydate','upload'], function () {
        var form = layui.form;
        var $ = layui.jquery;
        var laydate=layui.laydate;
        /* function quxiao(){
            alert(111);
        } */
        var $ = layui.jquery,
            upload = layui.upload;

        form.on('submit(*)', function(data){
            console.log(data.field);
            if(data.field.door2Door=='on'){
                data.field.door2Door = true;
            }else{
                data.field.door2Door = false;
            }
            var url = '/hy/basic/job/addJob';
            $.ajax({
                type:'POST',
                url:url,
                data:data.field,
                success: function(data){
                    if(data.msgcode=="200"){
                        alert("操作失败！");
                    }else{
                        alert("操作成功！");
                        window.parent.location.reload(); //刷新父页面
                        var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
                        parent.layer.close(index);  // 关闭layer
                    }
                }
            })
            return false;
        });

    })


</script>